Inspector Methods for State Abstraction
نویسندگان
چکیده
Most classes in an object-oriented program provide access to an object’s state through methods, so that client code does not depend on and cannot interfere with the object’s internal representation composed of fields and internal component objects. In order to extend the benefits of methods to specifications, method contracts may themselves be expressed using methods, hence providing support for state abstraction in specifications. In this paper, we propose an approach to the verification of programs that use inspector methods in method contracts and object invariants. Inspector methods must not have side-effects and must not throw exceptions, but they may have parameters, and they may depend on the state of objects passed as arguments. Our approach builds on the Boogie methodology for object invariants and ownership. Performing state abstraction in a programming language that allows aliasing through object references poses a framing problem. Specifically, client code needs to be able to tell whether modifying a given object or calling a given method may affect the value of a given inspector method call. We solve this by modeling inspector methods as functions that take as arguments only those parts of the heap on which they depend. Thanks to a novel logical encoding of the heap, we can do this without breaking information hiding, even in cases where inspector methods depend on internal component objects. The core of our approach has been implemented in a custom build of the Spec# program verifier.
منابع مشابه
Verification of Programs with Inspector Methods
Most classes in an object-oriented program provide access to an object’s state through methods, so that client code does not depend on and cannot interfere with the object’s internal representation composed of fields and internal component objects. Methods used for this purpose are sometimes called inspector methods. In order to extend the benefits of inspector methods to specifications, the me...
متن کاملIdentifying Inspectors to Mine Models of Object Behavior
In object oriented programming languages, classes are used to incorporate state (fields) and behavior (methods) that modifies the state. Typically, only a subset of a classes’ methods actually modifies the state. Methods that don’t modify the state are called side– effect free or pure methods. We propose to use purity information to classify methods as inspectors (methods that reveal informatio...
متن کاملHydrogen Abstraction Reaction of Hydroxyl Radical with 1,1-Dibromoethane and 1,2-Dibromoethane Studied by Using Semi-Classical Transition State Theory
The hydrogen abstraction reaction by OH radical from CH2BrCH2Br (R1) and CH₃CHBr2 (R2) is investigated theoretically by semi-classical transition state theory. The stationary points for both reactions are located by using ωB97X-D and KMLYP density functional methods along with cc-pVTZ basis. Single-point energy calculations are performed at the QCISD(T) and CCSD(T) levels of theory with differe...
متن کاملAb Initio Theoretical Studies on the Kinetics of the Hydrogen Abstraction Reaction of Hydroxyl Radical with CH3CH2OCF2CHF2 (HFE-374pc2)
The hydrogen abstraction reaction of OH radical with CH3CH2OCF2CHF2 (HFE-374pc2) is investigated theoretically by semi-classical transition state theory. The stationary points on the potential energy surface of the reaction are located by using KMLYP density functional method along with 6-311++G(d,p) basis set. Vibrational anharmonicity coefficients, ...
متن کاملThe Comets Inspector: Towards Run Time Plasticity Control Based on a Semantic Network
In this paper, we describe the Comets Inspector, a software tool that is intended to provide end users (yet, designers and/or developers) with a semantic network in order to control the plasticity of their User Interfaces (UI) at run-time. Thanks to a set of predefined relationships, the semantic network links together various concepts ranging from the final UI (i.e. in terms of available techn...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Journal of Object Technology
دوره 6 شماره
صفحات -
تاریخ انتشار 2007